<!doctype html>
<title>2D arrays</title>

<script>

var closet =
[
  ["ball", "yoyo", "teddy"],
  ["Austen", "Bronte", "Swift"],
  ["guitar", "tabla", "flute"]
];

//View the entire array.
//ball, yoyo, teddy, Austen, Bronte, 
//Swift, guitar, tabla, flute

console.log("Entire 2D array: " + closet);

//View the first array.
//ball, yoyo, teddy

console.log("Array 0: " + closet[0]);

//View the second array.
//Austen, Bronte, Swift

console.log("Array 1: " + closet[1]);

//The first element in the second array.
//Austen

console.log("First element of second array: " 
  + closet[1][0]);

//The third element in the third array.
//flute

console.log("Third element of third array: " 
  + closet[2][2]);

//The second element in the first array.
//yoyo

console.log("Second element of first array: " 
  + closet[0][1]);
  
</script>
